package com.nuaa.utils;

public class CustomCodeUtil {
	
	public final static int FRONT_CODE = 100000;
	/**
	 * 生成一个唯一的Id
	 * @param integer 
	 * @return
	 */
	public static String getCustomNo(Integer curID){
		StringBuilder sb = new StringBuilder();
		int cus_no_front = 1000;
		if(curID>=9000){
			sb.append("A"+(100+curID%1000));
		}else{
			int code = cus_no_front+curID;
			sb.append(code);
		}
		
		return sb.toString();
	}
	
	/**
	 * 生成换标订单编号
	 * @return order number 
	 */
	public static String getChangeOrderNo(Integer integer){
		StringBuilder sb = new StringBuilder("CH");
		int code = FRONT_CODE+integer;
		return sb.append(code).toString();
	}
	/**
	 * 生成中转订单编号
	 * @return order number 
	 */
	public static String getTransferOrderNo(Integer integer){
		StringBuilder sb = new StringBuilder("TR");
		int code = FRONT_CODE+integer;
		return sb.append(code).toString();
	}
	/**
	 * 生成退货订单编号
	 * @return order number 
	 */
	public static String getReturnOrderNo(Integer integer){
		StringBuilder sb = new StringBuilder("RE");
		int code = FRONT_CODE+integer;
		return sb.append(code).toString();
	}
	/**
	 * 生成备货发货订单编号
	 */
	public static String getBackupOrderNo(Integer integer){
		StringBuilder sb = new StringBuilder("BA");
		int code = FRONT_CODE+integer;
		return sb.append(code).toString();
	}
	/**
	 * 生成本地发货订单编号
	 */
	public static String getLocalDisOrderNo(Integer integer){
		StringBuilder sb = new StringBuilder("LO");
		int code = FRONT_CODE+integer;
		return sb.append(code).toString();
	}
	/**
	 * 生成商品编码
	 */
	public static String getProNo(Integer integer){
		StringBuilder sb = new StringBuilder("PRO");
		int code = FRONT_CODE+integer;
		return sb.append(code).toString();
	}
}
